package frontend.model.admin;

import backend.model.admin.ForeignManager;
import frontend.model.base.UIModel;

public class ForeignManagerUIModel implements UIModel<ForeignManager> {

    private String firstName;
    private String lastName;
    private boolean isActive;

    private ForeignManager foreignManager;

    public ForeignManagerUIModel() {
        foreignManager = new ForeignManager();
        isActive = true;
    }

    public ForeignManagerUIModel(ForeignManager foreignManager) {
        this.foreignManager = foreignManager;
        populateFieldsFromDBModel();
    }
    @Override
    public ForeignManager getDBModel() {
        return foreignManager;
    }

    @Override
    public void populateDBModelFromFields() {
        foreignManager.setFirstName(firstName);
        foreignManager.setLastName(lastName);
        foreignManager.setActive(isActive);
    }

    @Override
    public void populateFieldsFromDBModel() {
        firstName = foreignManager.getFirstName();
        lastName = foreignManager.getLastName();
        isActive = foreignManager.getIsActive();
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public boolean getIsActive() {
        return isActive;
    }
}
